import { createRouter, createWebHistory } from 'vue-router';

// 引入各页面组件
import Home from '../views/Home.vue';
import Residents from '../views/Residents.vue';
import Houses from '../views/Houses.vue';
import Properties from '../views/Properties.vue';
import Complaints from '../views/Complaints.vue';
import Activities from '../views/Activities.vue';
import System from '../views/System.vue';

// 配置路由
const routes = [
  {
    path: '/',
    name: 'Home',
    component: Home
  },
  {
    path: '/residents',
    name: 'Residents',
    component: Residents
  },
  {
    path: '/houses',
    name: 'Houses',
    component: Houses
  },
  {
    path: '/properties',
    name: 'Properties',
    component: Properties
  },
  {
    path: '/complaints',
    name: 'Complaints',
    component: Complaints
  },
  {
    path: '/activities',
    name: 'Activities',
    component: Activities
  },
  {
    path: '/system',
    name: 'System',
    component: System
  }
];

// 创建路由实例
const router = createRouter({
  history: createWebHistory(import.meta.env.BASE_URL), // 支持 HTML5 history 模式
  routes
});

export default router;
